const readfs = require("./readfs")
const writefs = require("./writefs")

//  通过 hello1.txt 找到 hello2.txt ，逐级最终找到 hello3.txt
async function readHello3(){
    let h1 = await readfs("./hello1.txt");
    let h2 = await readfs("./"+h1.trim()+".txt");
    let h3 = await readfs("./"+h2.trim()+".txt");       
    console.log(h3);
}

// readHello3()

async function write(){
    await writefs("food.txt","今晚吃啥？\n")
    await writefs("food.txt","红烧狮子头\n")
    await writefs("food.txt","狮子头不好吃，换一样吧\n")
    await writefs("food.txt","红焖鲤鱼\n")
}

write()